import { axios } from '@/utils/request'

const api = {
  list: '/mch/mch/list',
  save: '/mch/mch/save',
  del: '/mch/mch/del',
  upDown: '/mch/mch/up-down',
  saveSetting: '/mch/mch/save-setting',
  apply: '/mch/mch/apply'
}

export default api

export function list (parameter) {
  return axios({
    url: api.list,
    method: 'get',
    params: parameter
  })
}

export function del (parameter) {
  return axios({
    url: api.del,
    method: 'get',
    params: parameter
  })
}

export function save (parameter) {
  return axios({
    url: api.save,
    method: 'post',
    data: parameter
  })
}

export function upDown (parameter) {
  return axios({
    url: api.upDown,
    method: 'get',
    params: parameter
  })
}

export function saveSetting (parameter) {
  return axios({
    url: api.saveSetting,
    method: 'post',
    data: parameter
  })
}

export function apply (parameter) {
  return axios({
    url: api.apply,
    method: 'post',
    data: parameter
  })
}